<template>
	<view class="detail-wrap">
		<view v-for="item in materialList" :key="item.id">
			<view class="content-box">{{item.titile}}</view>
			<view class="other-info">
				<view class="read-num">
					<image src="../../static/img/info_slices/business_college_read.png" mode="" />
					{{item.readNum}}
				</view>
				<view class="item-right">
					{{item.addTime}}
				</view>
			</view>
			<view class="swiper-wrap" v-for="image in item.imgList" :key="image.id">
				<image :src="image" mode=""></image>
			</view>
			<view class="detail-info" v-html="item.content"></view>
			<view class="other-info">
				<view class="read-num">
					<image src="../../static/img/info_slices/-business_college_particular_comment.png" mode="" />
					{{item.commentNum}}
				</view>
				<view class="item-right">
					<image src="../../static/img/info_slices/business_college_particular_like.png" mode="" />
					{{item.likeNum}}
				</view>
			</view>
			
		</view>

	</view>
</template>

<script>
	var that;
	export default {
		data() {
			return {
				detailId: '',
				commentVal: '',
				title: '拥抱大品牌，选择大平台！携手开拓大健康领域 新篇章...',
				readNum: '24',
				creatTime: '2020-10-29',
				commentNum: 1,
				likeNum: 2039,
				detail: '拥抱大品牌，选择大平台！携手开拓大健康领域新篇章！拥抱大品牌，选择大平台！携手开拓大健康领域新篇章！拥抱大品牌，选择大平台！携',
				current: 0,
				materialList:[]
			};
		},
		onLoad(options) {

			this.$http.get(this.tui.interfaceUrl() + '/app/material/getMaterialCategory?categoryType=' + 4, {}).then(res => {
				let resData = res.data.data.list
				let id = resData[0].id
				
				
				this.$http.get(this.tui.interfaceUrl() + '/app/material/materialList?materialCategerId=' + id, {}).then(res => {
					console.log(res.data.data.list)
					this.materialList = res.data.data.list

				}).catch(err => {
					console.log(err)

				})

			}).catch(err => {
				console.log(err)

			})

		},

		methods: {



		}
	};
</script>

<style lang="less" scoped>
	.no-data {
		font-size: 24upx;
		line-height: 40upx;
		padding: 60upx 0;
		text-align: center;
		color: #CCCCCC;
	}

	.detail-wrap {
		background-color: #ffffff;
		padding: 30upx 30upx 0;

		.item-head {
			display: flex;
			align-items: center;
			padding: 20upx 40upx;
			width: 100%;
			justify-content: space-between;
			border-bottom: 1upx solid var(--mainColor);
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			z-index: 100;
			background-color: #fff;
			height: 120upx;

			.left-info {
				display: flex;
				align-items: center;

				.img-wrap {
					width: 70upx;
					height: 70upx;
					overflow: hidden;
					border-radius: 50%;
					margin-right: 20upx;

					.avatar {
						font-size: 32upx;
						font-weight: bold;
						color: rgba(51, 51, 51, 1);
						line-height: 43upx;
					}
				}

				.head-name {
					padding-left: 40upx;
					color: #666666;
					font-size: 32upx;
				}
			}

			.follow-btn {
				width: 140upx;
				height: 60upx;
				border: 1upx solid var(--mainColor);
				color: var(--mainColor);
				border-radius: 40upx;
			}

			.followed {
				color: #fff;
				background: var(--activeColor);
				border: 1upx solid var(--activeColor);
			}
		}

		.swiper-wrap {
			position: relative;

			image {
				width: 100%;
			}

		}

		.content-box {
			text-align: center;
			font-size: 32upx;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
			line-height: 43upx;
		}

		.detail-info {
			font-size: 28upx;
			font-weight: 400;
			color: rgba(128, 128, 128, 1);
			line-height: 34upx;
			margin-top: 20upx;
		}

		.other-info {
			display: flex;
			justify-content: space-between;
			padding: 20upx 0;

			.read-num {
				font-size: 24upx;
				font-weight: 400;
				color: rgba(128, 128, 128, 1);
				line-height: 43upx;

				image {
					width: 25upx;
					height: 20upx;
					margin-right: 5upx;
				}
			}

			.item-right {
				font-size: 24upx;
				font-weight: 400;
				color: rgba(128, 128, 128, 1);
				line-height: 43upx;

				image {
					width: 25upx;
					height: 20upx;
					margin-right: 5upx;
				}
			}
		}

		.comment-wrap {
			background-color: #fff;
			padding-bottom: 150upx;
			border-top: 10upx solid rgba(250, 250, 250, 1);

			.scroll-wrap {
				height: 100%;
				border-top: 1upx solid var(--mainColor);
			}

			.comment-num {
				padding: 30upx 0;
				font-size: 32upx;
				font-weight: bold;
				color: rgba(51, 51, 51, 1);
				line-height: 43upx;

				text {
					float: right;
					font-size: 24upx;
					font-weight: 400;
					color: rgba(128, 128, 128, 1);
					line-height: 43upx;
				}
			}

			.comment-item {
				// display: flex;
				// justify-content: space-between;

				.left-avatar {
					display: flex;


					.avatar {
						width: 70upx;
						height: 70upx;
						border-radius: 50%;
						overflow: hidden;
						border: 1upx solid #ECECEC;
					}

					.right-top {
						margin-left: 20upx;

						.reply {
							display: flex;
							font-size: 28upx;
						}

						.active {
							color: var(--activeColor) !important;
						}

						.title {
							font-size: 32upx;
							font-weight: bold;
							color: rgba(51, 51, 51, 1);
							line-height: 43upx;
						}

						.time {
							font-size: 24upx;
							font-family: PingFang SC;
							font-weight: 400;
							color: rgba(128, 128, 128, 1);
							line-height: 43upx;
						}
					}
				}

				.right-box {
					margin-left: 20upx;
					flex: 1;

					.right-mine {
						padding: 20upx;
						// background-color: #f5f8f9;
						border-radius: 10upx;
						flex: 1;

						.other-info {
							justify-content: flex-end;
						}
					}

					.content {
						font-size: 32upx;
						font-weight: 500;
						color: rgba(51, 51, 51, 1);
						line-height: 38upx;
					}
				}
			}
		}
	}
</style>
